package com.ximu.site.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ximu.common_utlis.jwt.JwtUtil;
import com.ximu.common_utlis.result.Result;
import com.ximu.redeemcode.entity.RedeemCode;
import com.ximu.site.entity.Site;
import com.ximu.site.mapper.SiteMapper;
import com.ximu.site.service.SiteService;
import io.jsonwebtoken.Claims;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ximu
 * @since 2023-10-14
 */
@RestController
@RequestMapping("/site")
@Api(tags = "全部站点接口")
public class SiteController {

    @Autowired
    private SiteService siteMapper;

    @ApiOperation(value = "全部站点")
    @GetMapping ("findAllSite")
    public Result findAllRedeemCode(){
        try {
            List<Site> list = siteMapper.list();
            return Result.ok().data("sitelist",list).message("成功");
        } catch (Exception e) {
            e.printStackTrace();
        }
        return Result.error().message("查询失败");
    }
}

